import store from "../store";

export function setUserInfo(data) {
    localStorage.setItem('userInfo', JSON.stringify(data))
}

export function getUserInfo() {
    return JSON.parse(localStorage.getItem('userInfo')) || { list: [] }
}

export function setMenus(data) {
    localStorage.setItem('menus', JSON.stringify(data))
}

export function getMenus() {
    return JSON.parse(localStorage.getItem('menus')) || {}
}

export function setRouter(data) {
  localStorage.setItem('router', JSON.stringify(data))
}

export function getRouter() {
  return JSON.parse(localStorage.getItem('router')) || []
}

export function setDepartment(data) {
    localStorage.setItem('department', JSON.stringify(data))
}

export function getDepartment() {
    return JSON.parse(localStorage.getItem('department')) || {}
}

export function setSysDic(data) {
  localStorage.setItem('sysDic', JSON.stringify(data))
}

export function getSysDic() {
  return JSON.parse(localStorage.getItem('sysDic')) || {}
}

export function setFileModel(data) {
  localStorage.setItem('fileModel', JSON.stringify(data))
}

export function getFileModel() {
  return JSON.parse(localStorage.getItem('fileModel')) || {}
}

export function setFileChildModel(data) {
  localStorage.setItem('fileModelChild', JSON.stringify(data))
}

export function getFileChildModel() {
  return JSON.parse(localStorage.getItem('fileModelChild')) || {}
}

